package io.renren.modules.pos.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.pos.dao.PosDao;
import io.renren.modules.pos.entity.PosEntity;
import io.renren.modules.pos.service.PosService;
@Service("posService")
public class PosServiceImpl extends ServiceImpl<PosDao, PosEntity> implements PosService {
    @Autowired
    PosDao posDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PosEntity> page = this.page(
                new Query<PosEntity>().getPage(params),
                new QueryWrapper<PosEntity>().like("pname",params.get("key"))
        );

        return new PageUtils(page);
    }

    @Override
    public List listNum() {
        return posDao.listNum();
    }

    @Override
    public void selectByPosname(String posname, Page<PosEntity> page) {
        posDao.selectByPosname(posname,page);
    }

    @Override
    public List listGroup() {
        return posDao.listGroup();
    }

}